<%="<span class=todo_item_label>" + "Avaliable todo items:".t + "</span>" if todo_items.size > 0%>
<%todo_items.each do |i|%>
 <%if params[:uid].to_i > 0%>
  <%next if i.user.nil?%>
  <%next if i.user and params[:uid].to_i != i.user.id%>
 <%end%>
<div id=todo_item_<%=i.id%> onmouseover="Element.show('action_<%=i.id%>')" onmouseout="Element.hide('action_<%=i.id%>')">
<span id="action_<%=i.id%>" style="display:none" class="todo_item_action">
<%=link_to_remote image_tag("trash.gif",:border=>0),:confirm=>"Are you sure?".t,:url=>{:controller=>'todos',:action=>'delete_todo_item',:id =>i.id},:loading=>"Element.hide('chk_#{i.id}');Element.show('indicator_#{i.id}');new Effect.Highlight('todo_item_#{i.id}');return false"%>
</span>
<%=image_tag"undo.gif"%>
<span id='chk_<%=i.id%>'><%=check_box_tag "todo_item_id",i.id,false,:onclick=>"new Ajax.Request('/todos/mark_finish/?todo_item_id=#{i.id}',{asynchronous:true, evalScripts:true});Element.show('indicator_#{i.id}');Element.hide('chk_#{i.id}')"%></span>
<%=indicator(i.id)%>
<span class="prior p_<%=(i.prior rescue 4)%>">&nbsp;</span>
<%="<strong>" + i.user.name + ":</strong>" if i.user_id > 0%>
<%=i.name%>
<% if i.todo.milestone%>
 <%="[" + i.started_at.strftime("%m/%d") + (i.due_at ? "-" + i.due_at.strftime("%m/%d"):"-" + "Next day".t) +"]" %>
<%end%>
</div>
<%end%>
